<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsList.aspx.cs" Inherits="Admin_Lable_Model_NewsList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>添加系统标签</title>
    <link rel="stylesheet" href="../../skin/Style.css" type="text/css" />
    <script type="text/javascript" src="../../js/CheckedAll.js"></script>
    <script type="text/javascript">
      function GetData(obj){   
　　      var svalue = obj.value;
　　      if(svalue=="type") {
　　          document.getElementById("ddlBindType").style.display="inline";
　　      }else{
　　          document.getElementById("ddlBindType").style.display="none";
　　          document.getElementById("ddlSecondType").style.display="none";
　　      }
      }
      function ShowStyle(){  
            var list = document.getElementsByName("rblIsPagination");
            for (var i=0; i < list.length; i++){
                if (list[1].tagName == "INPUT" && list[1].checked){
                      document.getElementById("PaginationStyle").style.display="inline";
                }else if(list[2].tagName == "INPUT" && list[2].checked) {
                    document.getElementById("PaginationStyle").style.display="none";
                } 
            }
      }
      function CheckTypeSelect() {
       var str= document.getElementsByName("ddlBindType");
       if(str.value=="-1") {
        alert("必须选择一个类别!");
        return ;
       }
      }
    </script>
    
    <script type="text/javascript">
    var xmlhttp;
    function AjaxGetData(obj)
    {
        var pro=obj.value;
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        xmlhttp.onreadystatechange=statechange;
        xmlhttp.Open("GET","NewsList.aspx?TypeID="+pro,true);
        xmlhttp.Send();
    }
    
    function statechange()
    {
        if(xmlhttp.readystate==4){
            if(xmlhttp.status==200) {
                FillData(xmlhttp.responseText);
            }
        }
    }
    function FillData(strName)
    {
        var ddl = document.getElementById("ddlSecondType"); 
        for (i = ddl.length; i >= 0; i--){ 
            ddl.options.remove(i); 
        } 
        document.getElementById("ddlSecondType").style.display="inline";
        document.getElementById("ddlSecondType").add(new Option("--请选择--","-1")); 
        var ArrayName=strName.substring(0,strName.indexOf("<!"));
        if(ArrayName.length>0) {
             var arrData=new Array();
             arrData= ArrayName.split(",");
             if(arrData.length==1)
                return;
             for(i=0;i<arrData.length;i++) {
                     if(i%2==0)
                         document.getElementById("ddlSecondType").add(new Option(arrData[i],arrData[i+1])); 
                     else
                         continue;
             }
        }
    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <table border="0" cellpadding="0" cellspacing="0" class="talbe_list">
            <tr>
                <td width="12%" class="left4">
                    标签名称：</td>
                <td width="88%" class="left2">
                    {SY_<asp:TextBox ID="txtEngLishName" runat="server"></asp:TextBox>}</td>
            </tr>
            <tr>
                <td class="left4">
                    备注：</td>
                <td class="left2">
                    <asp:TextBox ID="txtChineseName" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="left4">
                    所属页面：</td>
                <td class="left2">
                    <asp:DropDownList ID="dropLableType" runat="server">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td class="left4">
                    标签模版：</td>
                <td class="left2">
                    <asp:DropDownList ID="ddlModelType" runat="server">
                        <asp:ListItem Selected="True" Value="Select">--请选择--</asp:ListItem>
                        <asp:ListItem Value="String">文字</asp:ListItem>
                        <asp:ListItem Value="Image">图文</asp:ListItem>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td class="left4">
                    显示条数：</td>
                <td class="left2">
                    <asp:TextBox ID="txtNum" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="left4">
                    标题字数：</td>
                <td class="left2">
                    <asp:TextBox ID="txtTitleLength" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="left4">
                    内容字数：</td>
                <td class="left2">
                    <asp:TextBox ID="txtConterLength" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="left4">
                    日期格式：</td>
                <td class="left2">
                    <asp:DropDownList ID="dropDateClass" runat="server">
                        <asp:ListItem Selected="True" Value="yyyy-MM-dd">2005-10-1</asp:ListItem>
                        <asp:ListItem Value="yyyy.MM.dd">2005.10.1</asp:ListItem>
                        <asp:ListItem Value="yyyy/MM/dd">2005/10/1</asp:ListItem>
                        <asp:ListItem Value="MM/dd/yyyy">10/1/2005</asp:ListItem>
                        <asp:ListItem Value="yyyy年MM月dd日">2005年10月1日</asp:ListItem>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td class="left4">
                    信息类型：</td>
                <td class="left2">
                    <asp:DropDownList ID="ddlNewsType" runat="server" OnChange="GetData(this)">
                        <asp:ListItem Selected="True" Value="all">全部</asp:ListItem>
                        <asp:ListItem Value="type">类别</asp:ListItem>
                        <asp:ListItem Value="auto">自动绑定</asp:ListItem>
                        <asp:ListItem Value="other">相关信息</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlBindType" runat="server"  OnChange="AjaxGetData(this)"  style="display:none;">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlSecondType"  runat="server" style="display:none;" >
                    </asp:DropDownList>
                    </td>
            </tr>
            <tr>
                <td class="left4">
                    文章属性：</td>
                <td class="left2">
                    <asp:CheckBoxList ID="cblAttribute" runat="server" RepeatColumns="5" Width="300" RepeatLayout="Flow" RepeatDirection="Horizontal">
                        <asp:ListItem Value="IsRecommend">推荐</asp:ListItem>
                        <asp:ListItem Value="IsTop">头条</asp:ListItem>
                        <asp:ListItem Value="IsSlide">幻灯片</asp:ListItem>
                        <asp:ListItem Value="IsComment">允许评论</asp:ListItem>
                    </asp:CheckBoxList></td>
            </tr>
            <tr>
                <td class="left4">
                    排序：</td>
                <td class="left2">
                    <asp:DropDownList ID="ddlSort" runat="server">
                        <asp:ListItem Value="ID-asc">ID升序</asp:ListItem>
                        <asp:ListItem Value="ID-desc">ID降序</asp:ListItem>
                        <asp:ListItem Value="AddDate-asc">时间升序</asp:ListItem>
                        <asp:ListItem Value="AddDate-desc" Selected="True">时间降序</asp:ListItem>
                        <asp:ListItem Value="CountUp-asc">DIGG升序</asp:ListItem>
                        <asp:ListItem Value="CountUp-desc">DIGG降序</asp:ListItem>
                        <asp:ListItem Value="ClickCount-asc">点击数升序</asp:ListItem>
                        <asp:ListItem Value="ClickCount-desc">点击数降序</asp:ListItem>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td class="left4">
                    启用分页：</td>
                <td class="left2">
                    <asp:RadioButtonList ID="rblIsPagination" Onclick="ShowStyle()" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
                        RepeatLayout="Flow">
                        <asp:ListItem Value="1">是</asp:ListItem>
                        <asp:ListItem Selected="True" Value="0">否</asp:ListItem>
                    </asp:RadioButtonList></td>
            </tr>
            <tr id="PaginationStyle" runat="server" style="display:none;">
                <td class="left4">
                    分页样式：</td>
                <td class="left2">
                    当前页样式: <asp:TextBox ID="txtThisPage" Width="300"  runat="server"></asp:TextBox><br />
                    其它页样式: <asp:TextBox ID="txtOtherPage" runat="server" Width="300px"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                    <td class="left4">
                        标签头部：</td>
                    <td class="left2">
                        <textarea id="LabelHead" runat="server" style="width: 98%; height: 67px;"></textarea>
                    </td>
                </tr>
                <tr>
                    <td class="left4" style="height: 240px">
                        标签内容：<br />
                        <select size="13" runat="server" name="lst_AssociatorPageList" id="lst_AssociatorPageList"
                            ondblclick="selectcolumuname(this.value);" style="width: 110px; display: block;">
                            <option value="{PR:WS_Name}">资讯分类</option>
                            <option value="{PB_WEBURL}News/Trade-{PR:WS_TypeID}{PB_Postfix}">分类链接</option>
                            <option value="{PR:WS_Title}">资讯标题</option>
                            <option value="{PB_WEBURL}News/Detail-{PR:WS_ID}{PB_Postfix}">内容链接</option>
                            <option value="{PR:WS_Picture}">图片路径</option>
                            <option value="{PR:WS_AddDate}">添加日期</option>
                            <option value="{PR:WS_Reading}">导读</option>
                            <option value="{PR:WS_Author}">作者</option>
                            <option value="{PR:WS_Origin}">来源</option>
                            <option value="{PR:WS_ClickCount}">点击数</option>
                        </select>
                    </td>
                    <td class="left2" style="height: 240px">
                        <textarea rows="15" id="txtContent" runat="server" style="width: 99%"></textarea></td>
                </tr>
                <tr>
                    <td class="left4">
                        标签底部：</td>
                    <td class="left2">
                        <textarea id="LabelFoot" runat="server" style="width: 98%; height: 67px"></textarea></td>
                </tr>
          
            <tr>
                <td bgcolor="#F0F7FD" colspan="3">
                    <asp:Button ID="btnSave" runat="server" OnClientClick="CheckTypeSelect()"  Text="确定" CssClass="i_button" OnClick="btnSave_Click" />
                    <asp:Button ID="btnCancel" runat="server"  Text="取消" CssClass="i_button" OnClick="btnCancel_Click" />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
